/*
 * @Author: ShengXD <1519256482@qq.com>
 * @Date: 2024-11-06 15:13:31
 * @LastEditors: ShengXD <1519256482@qq.com>
 * @LastEditTime: 2024-11-12 10:31:28
 * @FilePath: /zonmind-om/apps/backend-mock/api/menu/current_user_list.ts
 * @Description:
 */
import { verifyAccessToken } from '~/utils/jwt-utils';
import { unAuthorizedResponse } from '~/utils/response';

export default eventHandler(async (event) => {
  const userinfo = verifyAccessToken(event);
  if (!userinfo) {
    return unAuthorizedResponse(event);
  }

  return useResponseSuccess([
    {
      component: 'BasicLayout',
      meta: {
        order: -1,
        icon: 'heroicons:home',
        activeIcon: 'heroicons:home-solid',
        title: '首页',
      },
      name: 'Dashboard',
      path: '/',
      redirect: '/workspace',
      children: [
        {
          name: 'Workspace',
          path: '/workspace',
          component: '/dashboard/workspace/index',
          meta: {
            affixTab: 1,
            keepAlive: 1,
            icon: 'heroicons:squares-2x2',
            activeIcon: 'heroicons:squares-2x2-solid',
            title: '工作台',
          },
        },
      ],
    },
    {
      component: 'BasicLayout',
      meta: {
        icon: 'heroicons:server-stack',
        activeIcon: 'heroicons:server-stack-solid',
        keepAlive: 1,
        order: 1000,
        title: '系统',
      },
      name: 'System',
      path: '/system',
      children: [
        {
          name: 'Setting',
          path: '/system/setting',
          meta: {
            icon: 'heroicons:cog-6-tooth',
            activeIcon: 'heroicons:cog-6-tooth-solid',
            title: '系统设置',
          },
          children: [
            {
              name: 'Explanation',
              path: '/system/setting/explanation',
              component: '_core/system/explanation/index',
              meta: {
                icon: 'heroicons:book-open',
                activeIcon: 'heroicons:book-open-solid',
                title: '名词解释',
              },
            },
            {
              name: 'SubAccounts',
              path: '/system/setting/subaccounts',
              component: '_core/system/subaccounts/index',
              meta: {
                icon: 'heroicons:identification',
                activeIcon: 'heroicons:identification-solid',
                title: '子账号管理',
              },
            },
            {
              name: 'Role',
              path: '/system/setting/role',
              component: '_core/system/role/index',
              meta: {
                icon: 'heroicons:user-group',
                activeIcon: 'heroicons:user-group-solid',
                title: '角色管理',
              },
            },
          ],
        },
        {
          name: 'Menu',
          path: '/system/menu',
          meta: {
            icon: 'heroicons:queue-list',
            activeIcon: 'heroicons:queue-list-solid',
            title: '菜单管理',
          },
          children: [
            {
              name: 'Menu10',
              path: '/system/menu/10',
              component: '_core/system/menu/index',
              meta: {
                icon: 'heroicons:book-open',
                activeIcon: 'heroicons:book-open-solid',
                title: '平台运营后台',
              },
            },
            {
              name: 'Menu7',
              path: '/system/menu/7',
              component: '_core/system/menu/index',
              meta: {
                icon: 'heroicons:book-open',
                activeIcon: 'heroicons:book-open-solid',
                title: '合作伙伴后台',
              },
            },
          ],
        },
      ],
    },
  ]);
});
